From: Matthew Daley Date: Wed, 6 Mar 2013 16:10:26 +0000 (+0100) Subject: fix domain unlocking in some xsm error paths X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7139 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=9581c4f9a55372a21e759cd449cb676d0e8feddb;p=xen.git fix domain unlocking in some xsm error paths A couple of xsm error/access-denied code paths in hypercalls neglect to unlock a previously locked domain. Fix by ensuring the domains are unlocked correctly. Signed-off-by: Matthew Daley Reviewed-by: Jan Beulich Acked-by: Keir Fraser --- diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 134eb73240..e8b4e7684a 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -111,7 +111,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p, ret = xsm_map_domain_pirq(XSM_TARGET, d); if ( ret ) - return ret; + goto free_domain; /* Verify or get irq. */ switch ( type ) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 287714b231..3f9732853a 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -2283,7 +2283,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop, rc = xsm_grant_setup(XSM_TARGET, current->domain, d); if ( rc ) { op.status = GNTST_permission_denied; - goto out1; + goto out2; } gt = d->grant_table;